#include "stdio.h"
#include "encryptAES.h"
void getThe4Words(char* path, __int16 state[17]);
void main(){
	__int16 state[17]={	
		0x32, 0x88, 0x31, 0xe0,
		0x43, 0x5a, 0x31, 0x37, 
		0xf6, 0x30, 0x98, 0x07, 
		0xa8, 0x8d, 0xa2, 0x34 };

	__int16 key[17] = {	
		0x2b, 0x28, 0xab,0x09,
		0x7e, 0xae, 0xf7, 0xcf,
		0x15, 0xd2, 0x15, 0x4f,
		0x16, 0xa6, 0x88, 0x3c };
	/*__int16 state[17] = { 0xA9, 0x8C, 0x45, 0xB7, 
	0x58, 0x96, 0x78, 0x55,
	0x19, 0xF2, 0xDE, 0x23,
	0xB1, 0x63, 0xA5, 0x12};
	__int16 key[17] = { 0x8f, 0xba, 0x8f, 0xba, 
	78, 0x98, 0x78, 0x98,
	0xc6, 0xa2, 0xc6, 0xa2,
	0x12, 0x16, 0x12, 0x16};*/
	encryptAES(state,key);
	decryptAES(state,key);


	for(int i=0;i<16 ;i++){
		printf("%x\t",state[i]);
		if((i+1)%4==0)printf("\n");
	}
}

void getThe4Words(char* path, __int16 state[17]){
	FILE *input;
	input = fopen(path, "r");
	for(int i = 0 ; i<4 ; i++){
		fscanf(input,"%x %x %x %x", &state[i*4], &state[1+i*4], &state[2+i*4],&state[3+i*4]);
	}
	fclose(input);
}
